<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	
	<h:head>
		<link rel="stylesheet" type="text/css" href="${request.contextPath}/theme/login.css" title="Style"/>
		<script type="text/javascript" src="${request.contextPath}/script/util.js"></script>
		
		<script language="javascript">
			function cerrar(){
				var ventana = window.self;
				ventana.opener = window.self;
				ventana.close();
			}
		</script>
	</h:head>
	<f:event type="preRenderView" listener="#{loginController.onPageLoad}"/>
	<h:form styleClass="form" id="form1">
		<div><br />
		<br />
		<br />
		<br />
		<br />
		<table cellspacing="0" cellpadding="0" border="1" style="height: 225px; width: 586px;" align="center">
			<tbody>
			<tr>
				<td>
				<table style="WIDTH: 600px; BACKGROUND-COLOR: white">
					<tr>
						<td colspan="6" style="text-align: left"><h:graphicImage style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 600px; HEIGHT: 79px; BORDER-RIGHT-WIDTH: 0px"
							id="image2" value="imagenes/banner/bannerBBVA3.png" alt=""></h:graphicImage></td>
					</tr>
					<tr>
						<td rowspan="1" style="width: 100px; text-align: left"><h:graphicImage
							id="Image1" value="imagenes/banner/02gk.jpg" style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 350px; HEIGHT: 221px; BORDER-RIGHT-WIDTH: 0px" 
							height="221" alt=""></h:graphicImage></td>
						<td colspan="5" valign="middle">
						<table id="TABLE1">
							<tr align="center">
								<td colspan="5"><h:outputText id="Label2"
									value="Ingreso al Sistema" styleClass="TextoAzul"></h:outputText></td>
							</tr>
							<tr>
								<td style="width: 100px; height: 10px"></td>
								<td colspan="3" style="height: 10px"></td>
								<td style="width: 100px; height: 10px"></td>
							</tr>
							<tr align="left">
								<td style="width: 100px"></td>
								<td style="width: 100px; text-align: right"><h:outputText
									id="Label1" value="Usuario:" styleClass="TextoAzul"></h:outputText></td>
								<td style="width: 16px"></td>
								<td style="width: 100px"><h:inputText id="txtUsuario"
									size="7" maxlength="7" required="true" style="width: 100px"
									value="#{loginModel.m_strTxtUsuario_Text}" onkeypress="complet(event,this)">
									<f:attribute name="requiredMsgKey" value="msgNameRequired" />
								</h:inputText></td>
								<td style="width: 100px; text-align: left"><h:message
									id="msgUsuario" styleClass="messages" for="txtUsuario"
									showDetail="false" showSummary="true"></h:message></td>
							</tr>
							<tr align="left">
								<td style="width: 100px"></td>
								<td style="width: 100px; text-align: right"><h:outputText
									id="Label3" value="Clave:" styleClass="TextoAzul"></h:outputText></td>
								<td style="width: 16px"></td>
								<td style="width: 100px"><h:inputSecret id="txtPassword"
									maxlength="8" size="8" required="true" style="width: 100px"
									value="#{loginController.m_strTxtPassword_Text}">
									<f:attribute name="requiredMsgKey" value="msgPassRequired" />
								</h:inputSecret></td>
								<td style="width: 100px; text-align: left"><h:message
									id="msgPassword" styleClass="messages" for="txtPassword"
									showDetail="false" showSummary="true"></h:message></td>
							</tr>
							<tr>
								<td style="width: 100px; height: 11px"></td>
								<td style="width: 100px; height: 11px; text-align: right"></td>
								<td style="width: 16px; height: 11px"></td>
								<td style="width: 100px; height: 11px"></td>
								<td style="width: 100px; height: 11px; text-align: left"></td>
							</tr>
							<tr>
								<td colspan="5" align="center">
									<h:commandButton action="#{loginController.validateLogin}" styleClass="btnAceptar" value=""/> 
									<h:commandButton id="btnReset" type="button" styleClass="btnCancelar" onclick="cerrar();"/>									
								</td>
							</tr>
						</table>
						</td>
					</tr>
					<tr>
						<td colspan="6" rowspan="1" id="Pie">
						</td>
					</tr>
				</table>
				</td>
			</tr>
			</tbody>
		</table>
			<center>
				<h:outputText id="lblError" styleClass="messages" value="#{loginController.m_strLblError_Text}" />
			</center>
		</div>
		<p:confirmDialog header="Vista expirada!!!" visible="#{not empty param['expired']}" 
            message="La vista ha expirado." severity="alert" widgetVar="confirmDlg">
            <p:commandButton type="button" value="Aceptar" onclick="confirmDlg.hide()" />
        </p:confirmDialog>
	</h:form>
</html>
